<!doctype html>
<html lang="en">
<head>
    <title>Login 10</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="../static/css/style.css">
	
	 <style type="text/css" >
	        #p1{
	            color: red;
	            margin: 10px auto;
	            text-align: center;
	        }
	   </style>

</head>
<body class="img js-fullheight" style="background-image: url(../static/images/bg.jpg);">
<section class="ftco-section">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-6 col-lg-4">
                <div class="login-wrap p-0">
                    <h3 class="mb-4 text-center">京唐国际</h3>
					<p id="p1"></p>
                    <form  method="post" id="login" class="signin-form">
                        <div class="form-group">
                            <input type="text" class="form-control" placeholder="用户名" name="username" required>
                        </div>
                        <div class="form-group">
                            <input id="password-field" type="password" class="form-control" name="password" placeholder="密码" required>
                            <span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="form-control btn btn-primary submit px-3" id="login1">登录</button>
                        </div>
                        <div class="form-group d-md-flex">
                            <div class="w-50">
                                <label class="checkbox-wrap checkbox-primary">记住密码
                                    <input type="checkbox" name="mianmi">
                                    <span class="checkmark"></span>
                                </label>
                            </div>

                            <div class="w-50 text-md-right">
                                <a class="txt1" href="#">
                                    忘记密码
                                    <i class="fa fa-long-arrow-right"></i>
                                </a>
                            </div>
                        </div>
                    </form>
                    <div class="w-100 text-center">
                        <a href="#" style="color: #fff">开发人员</a>
                    </div>
                    <p class="w-100 text-center">&mdash; 张乘献 李豪 骆志航 杨辉 &mdash;</p>
                </div>
            </div>
        </div>
    </div>
</section>

<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/popper.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/main.js"></script>
<script src="../static/js/jquery.serializejson.min.js"></script>

<script>

    $(function (){
        $("#login").submit(function(event){
            event.preventDefault();
            $.ajax({
                url : "/login/getVerify",
                type : "POST",
                contentType : "application/json",
                data : JSON.stringify($("#login").serializeJSON()),
                success : function (date){
                    if(date.userExsitjian == true){
                        alert(123)
                        location.href="/login/index";
                    }else {
                        alert(date.msg)
                        $("#p1").html(date.msg)
                    }
                },
                dataType : "JSON"
            });
        })
    })
</script>
</body>
</html>

